/*
 * @Description: 
 * @Author: yeeChen
 * @Date: 2022-12-21 14:28:05
 * @LastEditTime: 2022-12-21 14:32:29
 * @LastEditors: yeeChen
 */
const express = require('express')
const app = express()

app.use((req, res, next) => {
    const time = Date.now()
    req.startTime =time
    console.log('这是最简单的一个中间件');
    next()
})
app.get('/', (req, res) => {
    console.log('这是/路由');
    res.send('Home page'+req.startTime)
})
app.get('/user', (req, res) => {
    console.log('这是/user路由');
    res.send('User page'+req.startTime)
})


app.listen(80, function (req, res) {
    console.log('express running at http://127.0.0.1');
})
